package com.huanlis.consumer.thread;

import com.huanlis.consumer.util.LocalState;

public class LocalCache {
    private final InheritableThreadLocal<LocalState> localCache = new InheritableThreadLocal<>();


    public LocalState getCache() {
        return localCache.get();
    }

    public void  setCache(LocalState localState) {
        localCache.set(localState);
    }

    public void clear() {
        this.localCache.remove();
    }

}
